<template>
  <div class="equip-info">
    <div class="botton_sabe">
      <el-button
        v-debounce
        type="primary"
        size="small"
        :icon="Platform"
        @click="SaveBEMProcessDatasD"
        >保存工艺数据</el-button
      >
    </div>
    <div style="display: flex; align-items: center;position: relative;">
      <div class="content_steps_ab" style="position: absolute;">
        <div style='display: flex; align-items: center;width:50%'>
	<span style="font-size:11px;font-weight:bold;color:#13ce66">设计状态：</span>
				<el-steps
				style='width:78%;transform: scale(0.8) translate(-10%,-11%);'
        :space="120"
        :active="activeNumber"
        finish-status="success"
        process-status="finish"
        align-center
        size="small"
       
      >
    
        <el-step  :icon="Edit" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="设计"
>

<div v-if="activeNumber<=0" @click="changeStatue(10)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">1</div></div>

<div style="color:#81cc5c" v-if="activeNumber>=1" @click="(e)=>changeStatue(10,e)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
        <el-step :icon="Refresh" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="校核"
>

<div v-if="activeNumber<=1" @click="changeStatue(20)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">2</div></div>

<div  style="color:#81cc5c" v-if="activeNumber>=2" @click="changeStatue(20)" class="hand_me el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>

      
        <el-step :icon="CircleCheck" >

          

          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="审核"
>

<div v-if="activeNumber<=2" @click="changeStatue(30)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">3</div></div>

<div   style="color:#81cc5c" v-if="activeNumber>=3" @click="changeStatue(30)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
     
        <el-step :icon="CircleCheck" >

          

<template #icon>
  <el-tooltip
            
            placement="top-start"
            trigger="hover"
            content="已完成"
            >
            
            <div v-if="activeNumber<=2"  class="el-step__icon is-text"><div class="el-step__icon-inner">4</div></div>
            
            <div style="color:#81cc5c" v-if="activeNumber>=3"  class="el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>
            
            </el-tooltip>
 
</template>
</el-step>
      </el-steps>
	</div>

	<div style='display: flex; align-items: center;width:50%;'>
	<span style="font-size:11px;font-weight:bold;color:#1890ff">模型状态：</span>
				<el-steps
				style='width:78%;transform: scale(0.8) translate(-10%,-11%);'
        :space="120"
        :active="activeNumberModel"
        finish-status="success"
        process-status="finish"
        align-center
        size="small"
       
      >
    
        <el-step  :icon="Edit" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="设计"
>

<div v-if="activeNumberModel<=0" @click="changeStatueModel(10)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">1</div></div>

<div style="color:#81cc5c" v-if="activeNumberModel>=1" @click="(e)=>changeStatueModel(10,e)" class="hand_me el-step__icon is-text  is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>
        <el-step :icon="Refresh" >
          <template #icon>
            <el-tooltip
            
placement="top-start"
trigger="hover"
content="校核"
>

<div v-if="activeNumberModel<=1" @click="changeStatueModel(20)" class="hand_me el-step__icon is-text"><div class="el-step__icon-inner">2</div></div>

<div  style="color:#81cc5c" v-if="activeNumberModel>=2" @click="changeStatueModel(20)" class="hand_me el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>

</el-tooltip>
           
       </template>
        </el-step>

      
        <el-step :icon="CircleCheck" >

          

<template #icon>
  <el-tooltip
            
            placement="top-start"
            trigger="hover"
            content="已完成"
            >
            
            <div v-if="activeNumberModel<=1"  class="el-step__icon is-text"><div class="el-step__icon-inner">3</div></div>
            
            <div style="color:#81cc5c" v-if="activeNumberModel>=2"  class="el-step__icon is-text is-success"><i class="el-icon el-step__icon-inner is-status"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z" data-darkreader-inline-fill="" style="--darkreader-inline-fill: currentColor;"></path></svg></i></div>
            
            </el-tooltip>
 
</template>
</el-step>
      </el-steps>
	</div>
</div>
     
      <h1>工艺设计</h1>
      &nbsp;

      <el-popover
     
        :visible="visible"
        placement="bottom-start"
        title="设备信息"
        :width="300"
        trigger="hover"
      >
        <template #reference>
          <el-icon @mouseenter="visible = true">
            <Warning />
          </el-icon>
        </template>
        <div @mouseleave="visible = false">
          <div class="content_detail">
            <div class="item_content_d">
              <div class="fontent_s">设备位号:</div>
              <div>{{ equipInfo.equip_no }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备名称:</div>
              <div>{{ equipInfo.equip_name }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备形式:</div>
              <div>{{ equipInfo.equip_type }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设备类型:</div>
              <div>{{ equipInfo.equip_class }}</div>
            </div>

            <div class="item_content_d">
              <div class="fontent_s">设计人员:</div>
              <div>{{ equipInfo.equip_designer }}</div>
            </div>
          </div>

          <div  v-if='false' class="content_top">
            <el-steps
              :space="100"
              :active="activeNumber < 2 ? activeNumber : 3"
              finish-status="success"
              process-status="finish"
              align-center
              size="small"
              style="font-size: 12px"
            >
              <el-step :icon="Edit" title="设计"></el-step>
              <el-step :icon="Refresh" title="审核"></el-step>
              <el-step :icon="CircleCheck" title="完成"></el-step>
            </el-steps>

            <div class="button_item_b">
              <el-popconfirm
                :teleported="false"
                placement="top"
                @confirm="designComplete"
                title="确定设计完成?"
              >
                <template #reference>
                  <el-button
                    :icon="Edit"
                    size="small"
                    @mouseenter.stop=""
                    type="primary"
                    >设计完成</el-button
                  >
                </template>
              </el-popconfirm>

              <el-popconfirm
                :teleported="false"
                placement="left"
                @confirm="checkComplete"
                title="确定审核通过?"
              >
                <template #reference>
                  <el-button
                    :icon="Refresh"
                    size="small"
                    @mouseenter.stop=""
                    type="success"
                    >审核完成</el-button
                  >
                </template>
              </el-popconfirm>
            </div>
          </div>
        </div>
      </el-popover>
    </div>

    <div v-if='false' class="from_tenbal style2">
      <transition name="el-zoom-in-top">
        <el-form
          v-show="showTran"
          label-position="top"
          :inline="true"
          ref="designformRef"
          size="small"
          label-width="120px"
        >
          <div class="flex_style">
            <el-form-item label="公称直径">
              <el-input
                class="unit_input"
                v-model="processForm.diameter"
                placeholder="请输入公称直径"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="切高">
              <el-input
                class="unit_input"
                v-model="processForm.TL_to_TL"
                placeholder="请输入切高"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="全容积">
              <el-input
                class="unit_input"
                v-model="processForm.full_volume"
                placeholder="请输入全容积"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="公称容积">
              <el-input
                class="unit_input"
                v-model="processForm.nominal_volume"
                placeholder="请输入公称容积"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="图纸自然张数">
              <el-input
                class="unit_input"
                v-model="processForm.drawings_count"
                placeholder="请输入图纸自然张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="折A1张数">
              <el-input
                class="unit_input"
                v-model="processForm.a1_count"
                placeholder="请输入折A1张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="计算书自然张数">
              <el-input
                class="unit_input"
                v-model="processForm.cal_sheet_count"
                placeholder="请输入计算书自然张数"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="备注">
              <el-input
                class="unit_input"
                v-model="processForm.note"
                placeholder="请输入备注"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="风险评估报告">
              <el-select
                style="width: 160px"
                class="unit_input"
                v-model="processForm.risk_assessment_report"
                placeholder="请输入风险评估报告"
                size="small"
              >
                <el-option
                  v-for="item in [
                    {
                      value: '是',
                      label: '是',
                    },
                    {
                      value: '否',
                      label: '否',
                    },
                  ]"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-divider>
    <span style="font-size: 11px;color: #999"> 公共设计参数</span>
    </el-divider>
    <el-form-item label="容器内设计压力">
              <el-input
                class="unit_input"
                v-model="processForm.design_pressure_in_vessel"
                placeholder="请输入容器内设计压力"
                size="small"
              ></el-input>
            </el-form-item>
    <el-form-item label="壳体设计温度">
              <el-input
                class="unit_input"
                v-model="processForm.design_temp_in_shell"
                placeholder="请输入壳体设计温度"
                size="small"
              ></el-input>
            </el-form-item>
        

           

            <el-form-item label="容器内介质">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_in_vessel"
                placeholder="请输入容器内介质"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="容器内介质特性">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_properties_in_vessel"
                placeholder="请输入容器内介质特性"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="容器内主要受压元件材质">
              <el-input
                class="unit_input"
                v-model="processForm.main_pressure_comp_matl_in_vessel"
                placeholder="请输入容器内主要受压元件材质"
                size="small"
              ></el-input>
            </el-form-item>

            <el-form-item label="介质密度(kg/m3)">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_density"
                placeholder="请输入介质密度(kg/m3)"
                size="small"
              ></el-input>
            </el-form-item>
            <el-form-item label="保温厚度(mm)">
              <el-input
                class="unit_input"
                v-model="processForm.insulation_thickness"
                placeholder="请输入保温厚度(mm)"
                size="small"
              ></el-input>
            </el-form-item>
            <el-divider>
    <span style="font-size: 11px;color: #999">容器设计参数</span>
    </el-divider>

            <el-form-item label="夹套/盘管设计压力">
              <el-input
                class="unit_input"
                v-model="processForm.design_pressure_in_Jacket_coil"
                placeholder="请输入夹套/盘管设计压力"
                size="small"
              ></el-input>
            </el-form-item>
          

            <el-form-item label="夹套/盘管设计温度">
              <el-input
                class="unit_input"
                v-model="processForm.design_temp_in_Jacket_coil"
                placeholder="请输入夹套/盘管设计温度"
                size="small"
              ></el-input>
            </el-form-item>

       

           

            <el-form-item label="夹套/盘管介质">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_in_Jacket_coil"
                placeholder="请输入夹套/盘管介质"
                size="small"
              ></el-input>
            </el-form-item>

            

            <el-form-item label="夹套/盘管介质特性">
              <el-input
                class="unit_input"
                v-model="processForm.fluid_properties_in_Jacket_coil"
                placeholder="请输入夹套/盘管介质特性"
                size="small"
              ></el-input>
            </el-form-item>
          
            <el-form-item label="请输入夹套/盘管主要受压元件材质">
              <template #label>
                <el-tooltip
                  class="box-item"
                  effect="dark"
                  content="夹套/盘管主要受压元件材质"
                  placement="top-start"
                >
                  <div style="width: 140px">夹套/盘管主要受压元件....</div>
                </el-tooltip>
              </template>
              <el-input
                class="unit_input"
                v-model="processForm.main_pressure_comp_matl_in_Jacket_coil"
                placeholder="请输入夹套/盘管主要受压元件材质"
                size="small"
              ></el-input>
            </el-form-item>
        
          </div>
        </el-form>
      </transition>
    </div>




    <div  style='border:1px solid transparent'   class="from_tenbal">
			<el-scrollbar height='455px'>
        <div style='padding:0px 10px 5px 0px;' class="table_warp">

        <div class="left_table">


          <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设备类别
                
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
				<el-select class='height_100_width_65 font_size_small' size='small' v-model="equipInfo.vessel_type" placeholder="请选择">
                     <el-option
                       v-for="item in [
             {
                    value: 'Ⅰ',
                    label: 'Ⅰ',
                  },
                  {
                    value: 'Ⅱ',
                    label: 'Ⅱ',
                  },
                  {
                    value: 'Ⅲ',
                    label: 'Ⅲ',
                  },
 
                  {
                    value: 'I/SAD',
                    label: 'I/SAD',
                  },
                  {
                    value: 'II/SAD',
                    label: 'II/SAD',
                  },
                  {
                    value: 'III/SAD',
                    label: 'III/SAD',
                  },


                   {
                    value: '类外',
                    label: '类外',
                  },
             ]"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
                     ></el-option>
				 </el-select>
               
                  
               </div>
            </div>
          
           <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">容器类型
                
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
				<el-select class='height_100_width_65 font_size_small' size='small' v-model="equipInfo.equip_sub_type" placeholder="请选择">
                     <el-option
                       v-for="item in HEARtype"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
                     ></el-option>
				 </el-select>
               
                  
               </div>
            </div>


			<div class="row font_size_small box_font flex_my color_gray">
               <div class="box_font_left height_32 flex_my left_title border_right">工艺参数</div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">容器内</div>
                  <div class="height_32 flex_center left_title width_50">夹套/盘管</div>
               </div>
            </div>

            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设计压力 
                （MPa）
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_design_pressure_vessel'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_design_pressure_vessel'></el-input>
				    </div>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_design_pressure_jacket'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_design_pressure_jacket'></el-input>
				    </div>
                  </div>
               </div>
            </div>

            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作压力 （MPa）
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_pressure_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_pressure_jacket'></el-input>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">最大允许工作压力
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.mawp_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.mawp_jacket'></el-input>
                  </div>
               </div>
            </div>


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">设计温度 
               
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.max_design_temp_vessel'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.min_design_temp_vessel'></el-input>
				    </div>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
                    <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.design_temp_jacket'></el-input>

                  </div>
               </div>
            </div>


		


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作温度
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_temp_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_temp_jacket'></el-input>
                  </div>
               </div>
            </div>


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_jacket'></el-input>
                  </div>
               </div>
            </div>


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质特性
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_properties_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_properties_jacket'></el-input>
                  </div>
               </div>
            </div>


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">介质密度(G/L)
               
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_vessel_g'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_vessel_l'></el-input>
				    </div>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_jacket_g'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.fluid_density_jacket_l'></el-input>
				    </div>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">全容积
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.full_volume_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.full_volume_jacket'></el-input>
                  </div>
               </div>
            </div>

            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">工作容积
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_volume_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.operating_volume_jacket'></el-input>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">安全阀整定压力
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.safety_valve_set_pressure_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.safety_valve_set_pressure_jacket'></el-input>
                  </div>
               </div>
            </div>


			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">主要受压元件材质
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				{{ shell_mat1_metaid_ForMatter.CS }} / {{ tube_mat1_metaid_ForMatter.CS }}
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					
					 <el-cascader
					 style='width:80%'
					 class='height_100_width_65 font_size_small'
            
                placeholder='--'
                :show-all-levels="false"
               v-model="shell_mat1_metaid_ForMatter.values" size="small"
                 :options="cascaderOptions"
                     filterable />
				
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					
					<el-cascader
					 class='height_100_width_65 font_size_small'
                
                  placeholder='--'
                :show-all-levels="false"
               v-model="tube_mat1_metaid_ForMatter.values" size="small"
                 :options="cascaderOptions"
                     filterable />

				
                  </div>
               </div>
            </div>


			
			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">腐蚀裕量
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.corrosion_allowance_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.corrosion_allowance_jacket'></el-input>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">公称直径
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.diameter_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.diameter_jacket'></el-input>
                  </div>
               </div>
            </div>


            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">切高
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.tl_to_tl_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.tl_to_tl_jacket'></el-input>
                  </div>
               </div>
            </div>





		
            <div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right"> 焊接接头系数 （筒体/封头）
               
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.shell_weldedjoint_coefficient_vessel'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.head_weldedjoint_coefficient_vessel'></el-input>
				    </div>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.shell_weldedjoint_coefficient_jacket'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.head_weldedjoint_coefficient_jacket'></el-input>
				    </div>
                  </div>
               </div>
            </div>



			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">绝热材料/厚度
               
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_material_vessel'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_thickness_vessel'></el-input>
				    </div>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<div class="height_32 flex_center border_right left_title width_50">
                     <el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_material_jacket'></el-input>
				    </div>
					<div class="height_32 flex_center left_title width_50">
						<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.insulation_thickness_jacket'></el-input>
				    </div>
                  </div>
               </div>
            </div>


		
			
			<div class="row font_size_small box_font flex_my">
               <div class="box_font_left height_32 flex_my left_title border_right">装量系数
				
               </div>
               <div class="box_font_right flex_center height_32 flex_my">
                  <div class="height_32 flex_center border_right left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.filling_ratio_vessel'></el-input>
                  </div>
                  <div class="height_32 flex_center left_title width_50">
					<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.filling_ratio_jacket'></el-input>
                  </div>
               </div>
            </div>









		   <div class="row font_size_small box_font flex_my color_gray">
               <div class="box_font_left height_32 flex_my left_title ">
				
               </div>
               
            </div>



			
			<div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">图纸自然张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.drawings_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">折A1张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.a1_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">计算书自然张数
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.cal_sheet_count'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">风险评估报告
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.risk_assessment_report'></el-input>
		   </div>
		   </div>


		   <div class="row font_size_small box_font flex_my">
           
		   <div class="box_font_left height_32 flex_my left_title border_right">备注
			
		   </div>
		   <div class="box_font_right flex_center height_32 flex_my">
			<el-input class='height_100_width_65 font_size_small' size='small' v-model='processForm.note'></el-input>
		   </div>
		   </div>


      </div>
	  </div>
      </el-scrollbar>


		</div>




    <el-dialog style="position: relative" v-model="newDataDio" title="比对数据" width="40%">
			<el-alert title="发现新工艺参数数据！！" type="warning" description="确认是否保存数据中心工艺参数数据！" show-icon />
			<div style="display: flex; align-items: center; margin-top: 20px; justify-content: space-between">
				

				<el-table height='400px' :header-cell-style="{ background: '#fafbfc', color: '#333333' }" size="small" :data='newObjDio'>
                <el-table-column prop="name" label="参数名称">
					<template #scope="scope">

					  <div v-if='scope.row.name!==undefined'>{{ scope.row.name }}</div>
					  <div v-else>{{ scope.row.key }}</div>
					</template>
				</el-table-column>
				<el-table-column prop="value" label="数据中心参数（新）"></el-table-column>
				<el-table-column prop="value2" label="本地参数（旧）"></el-table-column>
				</el-table>
			</div>

			<div style="margin-top: 20px;" class="button_flex">
        <el-button @click="saveCenterAndUP" type="primary">接收并升版</el-button>
				&nbsp;&nbsp;&nbsp;&nbsp;
				
			
        <el-button @click="saveNoCenter" type="danger">不接收</el-button>
        &nbsp;&nbsp;&nbsp;
        <el-button @click="saveCenter" class="my_btn_receiver" type="success">仅接收</el-button>
       
			
			</div>
		</el-dialog>
  </div>
</template>
  
  <script setup>
import {
  Check,
  Delete,
  CircleCheck,
  Platform,
  Refresh,
  Edit,
  Message,
  Search,
  Star,
  DocumentCopy,
  Top,
  Bottom,
  Warning,
} from "@element-plus/icons-vue";
import { useProjectStore } from "/@/stores/project";
import { ElMessage, ElMessageBox, ElNotification,ElLoading } from "element-plus";
import {
  defineAsyncComponent,
  ref,
  reactive,
  onMounted,
  nextTick,
  computed,
  watch,
} from "vue";
import {
  SaveEquipSubType,
  ModifyEquipModelStatusV2,
  ModifyEquipStatus,
  SaveVesselsProcessData,
  UpdateEquipVesselType,
  GetVesselsProcessDatas,
  calculateshape,
  ImportExcelForModelInput,
  ExportExcelForModelInput,
  
  DeleteNozzle,
  AddNozzle,
  ModifyNozzle,
  GetEquipmentNozzle,
  DeleteAllShape,
  AddShape,
  UpdateLastModifyTime,
  ModifyShape,
  getequipmentshape,
  SaveNozzleDesignDatas,
  saveBEMDesigndatas,
  SaveModelParam,
  DelBEMNozzleDesignDatas,
  GetNozzleReinforcingRingMeta,
  GetNozzleInternalComponentsMeta,
  GetNozzleConnectTubeMaterialMeta,
  GetBEMNozzleDesignDatas,
  getBEMdesigndatas,
  getArrangeAnglemetadatas,
  getbooloptiondatas,
  getGasketTypeMetadatas,
  getStandardMetadatas,
  getRatingMetadatas,
  GetVesselsProcessDatasFromDataCenter,
  UpgradeEquip,
  GetMaterialMetaDatas
} from "../../../api/equipment/index";
import { NozzleInfo as NozzleInfoOptions } from "../../../utils/nozzleTypeInfo";
import {
  HEquipShapeTypes,
  VEquipShapeTypes,
  ShapeParams,
  NozzleParamOptions,
} from "../../../assets/js/equiipentBaseDatas";
import { liftingLegTypes as liftingLegTypesD } from "../../../assets/js/LiftingLug.js";
import { useEquipmentStore } from "../../../stores/equipment";
import { useRoute } from "vue-router";
let route = useRoute()
let store = useEquipmentStore();

let equip_oid = ref("");
let equipInfo = ref({});
const projectStore = useProjectStore();

let newDataDio = ref(false)
	let newObjDio = ref([])
	let oldObjData = ref([])


  let saveNoCenter = async () => {
		// await UpdateDataCenterBEMProcessDataState({
		// 	proj_no: projectStore.projectInfo.proj_no,
		// 	unit_no: equipInfo.value.equip_unit_no,
		// 	equip_no: equipInfo.value.equip_no,
		// 	equip_state: '已拒收',
		// })
		// newDataDio.value = false
		// ElMessage({
		// 	message: '已拒收数据中心工艺数据',
		// 	type: 'success',
		// })
	}



  let saveCenter = async () => {
		// await UpdateDataCenterBEMProcessDataState({
		// 	proj_no: projectStore.projectInfo.proj_no,
		// 	unit_no: equipInfo.value.equip_unit_no,
		// 	equip_no: equipInfo.value.equip_no,
		// 	equip_state: '已接收',
		// })

		sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value))
		let oid = processForm.value.oid
	
    await SaveEquipSubType({equip_sub_type:equipInfo.value.equip_sub_type,equip_oid:equip_oid.value})
    let obj = {
      "oid": processForm.value.oid||'',
    "equip_oid": processForm.value.equip_oid,
    "max_design_pressure_vessel": processForm.value.max_design_pressure_vessel,
    "min_design_pressure_vessel": processForm.value.min_design_pressure_vessel,
    "operating_pressure_vessel": processForm.value.operating_pressure_vessel,
    "mawp_vessel": processForm.value.mawp_vessel,
    "max_design_temp_vessel": processForm.value.max_design_temp_vessel,
    "min_design_temp_vessel": processForm.value.min_design_temp_vessel,
    "operating_temp_vessel": processForm.value.operating_temp_vessel,
    "fluid_vessel": processForm.value.fluid_vessel,
    "fluid_properties_vessel": processForm.value.fluid_properties_vessel,
    "fluid_density_vessel_g": processForm.value.fluid_density_vessel_g,
    "fluid_density_vessel_l": processForm.value.fluid_density_vessel_l,
    "operating_volume_vessel": processForm.value.operating_volume_vessel,
    "full_volume_vessel": processForm.value.full_volume_vessel,
    "safety_valve_set_pressure_vessel": processForm.value.safety_valve_set_pressure_vessel,
    "main_material_vessel": processForm.value.main_material_vessel,
    "corrosion_allowance_vessel": processForm.value.corrosion_allowance_vessel,
    "diameter_vessel": processForm.value.diameter_vessel,
  
    "shell_weldedjoint_coefficient_vessel": processForm.value.shell_weldedjoint_coefficient_vessel,
    "head_weldedjoint_coefficient_vessel": processForm.value.head_weldedjoint_coefficient_vessel,
    "insulation_thickness_vessel": processForm.value.insulation_thickness_vessel,
    "insulation_material_vessel": processForm.value.insulation_material_vessel,
    "filling_ratio_vessel": processForm.value.filling_ratio_vessel,
    "max_design_pressure_jacket": processForm.value.max_design_pressure_jacket,
    "min_design_pressure_jacket": processForm.value.min_design_pressure_jacket,
    "operating_pressure_jacket": processForm.value.operating_pressure_jacket,
    "mawp_jacket": processForm.value.mawp_jacket,
    "design_temp_jacket": processForm.value.design_temp_jacket,
    "operating_temp_jacket": processForm.value.operating_temp_jacket,
    "fluid_jacket": processForm.value.fluid_jacket,
    "fluid_properties_jacket": processForm.value.fluid_properties_jacket,
    
    "operating_volume_jacket": processForm.value.operating_volume_jacket,
    "full_volume_jacket": processForm.value.full_volume_jacket,
    "safety_valve_set_pressure_jacket": processForm.value.safety_valve_set_pressure_jacket,
    "main_material_jacket": processForm.value.main_material_jacket,
    "corrosion_allowance_jacket": processForm.value.corrosion_allowance_jacket,
    "diameter_jacket": processForm.value.diameter_jacket,
   
    "shell_weldedjoint_coefficient_jacket": processForm.value.shell_weldedjoint_coefficient_jacket,
    "head_weldedjoint_coefficient_jacket": processForm.value.head_weldedjoint_coefficient_jacket,
    "insulation_thickness_jacket": processForm.value.insulation_thickness_jacket,
    "insulation_material_jacket": processForm.value.insulation_material_jacket,
    "filling_ratio_jacket": processForm.value.filling_ratio_jacket,
    "version": processForm.value.version,
    "drawings_count":  processForm.value.drawings_count,
    "a1_count": processForm.value.a1_count,
    "cal_sheet_count": processForm.value.cal_sheet_count,
    "risk_assessment_report": processForm.value.risk_assessment_report,
    "note": processForm.value.note,
    "create_user": processForm.value.create_user,
    "create_time": processForm.value.create_time,
    "modify_user": processForm.value.modify_user,
    
  
    "fluid_density_jacket_g": processForm.value.fluid_density_jacket_g,
    "fluid_density_jacket_l": processForm.value.fluid_density_jacket_l,
    "tl_to_tl_vessel": processForm.value.tl_to_tl_vessel,
    "tl_to_tl_jacket": processForm.value.tl_to_tl_jacket,
    }
    if(!obj.oid) delete obj.oid
		await SaveVesselsProcessData({
			...obj,
			equip_oid: equip_oid.value,
			oid: oid,
			modify_user: JSON.parse(localStorage.getItem('userMessage')).user_name,
		})

    getBEMprocessdatasData();
		ElMessage({
			message: '保存数据中心工艺数据成功',
			type: 'success',
		})
		newDataDio.value = false
    return true
	}


  let saveCenterAndUP = async() => {
     await UpgradeEquipFn()
	}

  let activeNumberModel = ref(0)



  let shell_mat1_metaid_ForMatter = ref({
		CS:'--',
		values:'--',
	})
	let tube_mat1_metaid_ForMatter = ref({
		CS:'--',
		values:'--',
	})

  let forMatterMetaid = () => {
		processForm.value.main_material_vessel = `${shell_mat1_metaid_ForMatter.value.CS}|${shell_mat1_metaid_ForMatter.value.values}`
	    processForm.value.main_material_jacket = `${tube_mat1_metaid_ForMatter.value.CS}|${tube_mat1_metaid_ForMatter.value.values}`
	
	
		
		console.log(processForm.value)
	}


  let UpgradeEquipFn = () => {
    return new Promise(async(resolve) => {
      let id
      try {
        id = await UpgradeEquip({
          equip_oid: equip_oid.value,
       })
       setTimeout(()=>{
				const loading = ElLoading.service({
      lock: true,
      text: '正在执行升版操作，请稍等...',
       background: 'rgba(255,255, 255, 1)',
  })
    loading.$el.style.zIndex = 999999
			document.querySelectorAll('.is-active')[1].click()
    	setTimeout(()=>{
			document.querySelector('.el-message-box .el-button--primary').click()
			sessionStorage.setItem('autoRouter', true)
      sessionStorage.setItem('UpgradeEquipProcess', true)
      sessionStorage.setItem('UpgradeEquipId', id)
		},500)
     setTimeout(() => {
    loading.close()
    resolve(true)
  }, 6000)  
	  },300)
      } catch (error) {
        ElMessage({
          message: '升版失败，请确认设备是否被删除',
          type: 'error',
        })
      }
    })
  }


onMounted(async() => {
  equip_oid.value = route.query.equip_oid
  equipInfo.value = JSON.parse(sessionStorage.getItem(equip_oid.value));

 let processdatasData = await getBEMprocessdatasData();

 let VesselsProcessDatasFromDataCenter = await GetVesselsProcessDatasFromDataCenterData()
 
 if (sessionStorage.getItem('hasNewProcess')&&JSON.parse(sessionStorage.getItem('hasNewProcess'))) {
			for (let i in VesselsProcessDatasFromDataCenter) {
				for (let j in processdatasData) {
					if (i == j) {
						
						if (VesselsProcessDatasFromDataCenter[i] !== processdatasData[j].toString()) {
							newObjDio.value.push({
								key: i,
								value: VesselsProcessDatasFromDataCenter[i],
								name: nameFn(i),
								value2:processdatasData[j],
							})
							oldObjData.value.push({
								key: j,
								value: processdatasData[j],
								name: nameFn(j),
							})

						}
         
					}
				}
			}

      let isPresent_larg_version = newObjDio.value.some(obj => obj.key === 'version');
			if(!isPresent_larg_version) ( newObjDio.value.push({
              key: 'version',
              value: VesselsProcessDatasFromDataCenter['version'],
              name: nameFn('version'),
              value2:processdatasData['version'],
            }))

		

			newDataDio.value = true
		}

    if(sessionStorage.getItem('UpgradeEquipProcess')&&JSON.parse(sessionStorage.getItem('UpgradeEquipProcess'))){
      sessionStorage.setItem('UpgradeEquipProcess', false)
      setTimeout(()=>{
       document.querySelector('.my_btn_receiver').click()
      })
    }

  activeNumber.value = Math.floor(Number(equipInfo.value.equip_check)) / 10
  activeNumberModel.value = Number(equipInfo.value.model_stage) / 10



  let resCascader = await GetMaterialMetaDatas()
      cascaderOptions.value = transformData(resCascader);
});

let cascaderOptions = ref([])



let transformData =(data) =>{
  // 使用对象存储分组结果
  const resultMap = {};

  data.forEach(item => {
    const standard = item.standard;
    const materialType = item.materialType;
    const materialName = item.materialName;

    // 处理标准层级
    if (!resultMap[standard]) {
      resultMap[standard] = {
        value: standard,
        label: standard,
        children: {}
      };
    }

    // 处理材料类型层级
    if (!resultMap[standard].children[materialType]) {
      resultMap[standard].children[materialType] = {
        value: materialType,
        label: materialType,
        children: []
      };
    }

    // 添加材料名称（去重）
    const exists = resultMap[standard].children[materialType].children
      .some(child => child.value === materialName);
      
    if (!exists) {
      resultMap[standard].children[materialType].children.push({
        value: materialName,
        label: materialName
      });
    }
  });

  // 转换为最终数组格式
  return Object.values(resultMap).map(standard => ({
    value: standard.value,
    label: standard.label,
    children: Object.values(standard.children).map(type => ({
      value: type.value,
      label: type.label,
      children: type.children
    }))
  }));
}

let nameFn = i => {
  if (i == 'diameter') {
  return '公称直径'
}
if (i == 'TL_to_TL') {
  return '切高'
}
if (i == 'tL_to_tL') {
  return '切高'
}
if (i == 'full_volume') {
  return '全容积'
}
if (i == 'nominal_volume') {
  return '公称容积'
}
if (i == 'drawings_count') {
  return '图纸自然张数'
}
if (i == 'A1_count') {
  return '折A1张数'
}
if (i == 'cal_sheet_count') {
  return '计算书自然张数'
}
if (i == 'note') {
  return '备注'
}
if (i == 'risk_assessment_report') {
  return '风险评估报告'
}
if (i == 'design_pressure_in_vessel') {
  return '容器内设计压力'
}
if (i == 'design_temp_in_shell') {
  return '壳体设计温度'
}

  if (i == 'fluid_in_vessel') {
  return '容器内介质'
}



if (i == 'fluid_properties_in_vessel') {
  return '容器内介质特性'
}


if (i == 'main_pressure_comp_matl_in_vessel') {
  return '容器内主要受压元件材质'
}


if (i == 'fluid_density') {
  return '介质密度(kg/m3)'
}


if (i == 'insulation_thickness') {
  return '保温厚度(mm)'
}

if (i == 'design_pressure_in_Jacket_coil') {
  return '夹套/盘管设计压力'
}


if (i == 'design_temp_in_Jacket_coil') {
  return '夹套/盘管设计温度'
}

if (i == 'fluid_in_Jacket_coil') {
  return '夹套/盘管介质'
}

if (i == 'fluid_properties_in_Jacket_coil') {
  return '夹套/盘管介质特性'
}

if (i == 'main_pressure_comp_matl_in_Jacket_coil') {
  return '夹套/盘管主要受压元件材质'
}




if (i == 'tube_pressure') {
  return '管程工作压力'
}
if (i == 'tube_design_pressure1') {
  return '管程设计压力1'
}
if (i == 'tube_design_pressure2') {
  return '管程设计压力2'
}
if (i == 'tube_operate_temperature_in') {
  return '管程工作温度_进'
}
if (i == 'tube_operate_temperature_out') {
  return '管程工作温度_出'
}
if (i == 'tube_design_temperature1') {
  return '管程设计温度1'
}
if (i == 'tube_design_temperature2') {
  return '管程设计温度2'
}
if (i == 'tube_wall_temperature') {
  return '管程壁温'
}
if (i == 'tube_fluidname') {
  return '管程介质名称'
}
if (i == 'tube_fluid_property') {
  return '管程介质特性'
}
if (i == 'tube_fluid_density_in') {
  return '管程介质密度进'
}
if (i == 'tube_fluid_density_out') {
  return '管程介质密度出'
}
if (i == 'tube_mat1_metaid') {
  return '管程主要受压元件材质'
}
if (i == 'tube_mat2_metaid') {
  return '管程主体材料2'
}
if (i == 'heatexchange_tube_metaid') {
  return '换热管材料'
}
if (i == 'tube_corrosion_allowance') {
  return '管程腐蚀裕量'
}
if (i == 'tube_weldedjoint_coefficient') {
  return '管程焊接接头系数'
}
if (i == 'tube_head_weldedjoint_coefficient') {
  return '管程封头焊接接头系数'
}
if (i == 'tube_insulation_mat') {
  return '管程保温材料'
}
if (i == 'tube_insulation_thickness') {
  return '管程保温厚度'
}
if (i == 'tube_inlet_massflow') {
  return '管程进口质量流量'
}
if (i == 'tube_outlet_massflow') {
  return '管程出口质量流量'
}
if (i == 'tube_speed') {
  return '管程流速'
}
if (i == 'tube_nominal_diam') {
  return '管程直径'
}
if (i == 'bafflecut_adjust') {
  return '折流板切缺率'
}
if (i == 'bafflecut_dir') {
  return '折流板切缺方向'
}
if (i == 'ntiw') {
  return 'NTIW'
}
if (i == 'bafflecut_toleft_dis') {
  return '折流板距左侧管板密封面距离'
}
if (i == 'bafflecut_spacing') {
  return '折流板间距'
}
if (i == 'baffle_count') {
  return '折流板数量'
}
if (i == 'tube_diameter') {
  return '换热管外径'
}
if (i == 'tube_thickness') {
  return '换热管壁厚'
}
if (i == 'tube_length') {
  return '换热管长度'
}
if (i == 'shell_pressure') {
  return '壳程工作压力'
}
if (i == 'shell_design_pressure1') {
  return '壳程设计压力1'
}
if (i == 'shell_design_pressure2') {
  return '壳程设计压力2'
}
if (i == 'shell_operate_temperature_in') {
  return '壳程工作温度_进'
}
if (i == 'shell_operate_temperature_out') {
  return '壳程工作温度_出'
}
if (i == 'shell_design_temperature1') {
  return '壳程设计温度1'
}
if (i == 'shell_design_temperature2') {
  return '壳程设计温度2'
}
if (i == 'shell_wall_temperature') {
  return '壳程壁温'
}
if (i == 'shell_fluidname') {
  return '壳程介质名称'
}
if (i == 'shell_fluid_property') {
  return '壳程介质特性'
}
if (i == 'shell_fluid_density_in') {
  return '壳程介质密度进'
}
if (i == 'shell_fluid_density_out') {
  return '壳程介质密度出'
}
if (i == 'shell_mat1_metaid') {
  return '壳程主要受压元件材质'
}
if (i == 'shell_mat2_metaid') {
  return '壳程主体材料2'
}
if (i == 'shell_corrosion_allowance') {
  return '壳程腐蚀裕量'
}
if (i == 'shell_weldedjoint_coefficient') {
  return '壳程焊接接头系数'
}
if (i == 'shell_head_weldedjoint_coefficient') {
  return '壳程封头焊接接头系数'
}
if (i == 'shell_insulation_mat') {
  return '壳程保温材料'
}
if (i == 'shell_insulation_thickness') {
  return '壳程保温厚度'
}
if (i == 'shell_inlet_massflow') {
  return '壳程进口质量流量'
}
if (i == 'shell_outlet_massflow') {
  return '壳程出口质量流量'
}
if (i == 'shell_speed') {
  return '壳程流速'
}
if (i == 'drawings_count') {
  return '图纸自然张数'
}
if (i == 'A1_count') {
  return '折A1张数'
}
if (i == 'cal_sheet_count') {
  return '计算书自然张数'
}
if (i == 'note') {
  return '备注'
}
if (i == 'risk_assessment_report') {
  return '风险评估报告'
}

if(i=='version'){
return '大版本'
}


}

let newFormData = ref({})
	let GetVesselsProcessDatasFromDataCenterData = async () => {
    try{
      let res = await GetVesselsProcessDatasFromDataCenter({
			proj_no: projectStore.projectInfo.proj_no,
			unit_no: equipInfo.value.equip_unit_no,
			equip_no: equipInfo.value.equip_no,
      user:JSON.parse(localStorage.getItem("userMessage")).user_account,
		})
    newFormData.value = res
		return res
    }catch(err){
      newFormData.value = []
      return []

    }
		
		
	}



  let HEARtype = ref([
    {
      value: "常压容器",
      label: "常压容器",
    },
    {
      value: "压力容器",
      label: "压力容器",
    },
    {
      value: "疲劳容器",
      label: "疲劳容器",
    },
    {
      value: "卧式容器",
      label: "卧式容器",
    },
    {
      value: "夹套/盘管容器",
     label: "夹套/盘管容器",
    }
  ])
  

let activeNumber = ref(0);
let equip_sub_type  = ref('')
let SaveBEMProcessDatasD = async () => {
 
  try {
    forMatterMetaid()
   
    sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
    await SaveEquipSubType({equip_sub_type:equipInfo.value.equip_sub_type,equip_oid:equip_oid.value})

    let obj = {
      "oid": processForm.value.oid||'',
    "equip_oid": processForm.value.equip_oid,
    "max_design_pressure_vessel": processForm.value.max_design_pressure_vessel,
    "min_design_pressure_vessel": processForm.value.min_design_pressure_vessel,
    "operating_pressure_vessel": processForm.value.operating_pressure_vessel,
    "mawp_vessel": processForm.value.mawp_vessel,
    "max_design_temp_vessel": processForm.value.max_design_temp_vessel,
    "min_design_temp_vessel": processForm.value.min_design_temp_vessel,
    "operating_temp_vessel": processForm.value.operating_temp_vessel,
    "fluid_vessel": processForm.value.fluid_vessel,
    "fluid_properties_vessel": processForm.value.fluid_properties_vessel,
    "fluid_density_vessel_g": processForm.value.fluid_density_vessel_g,
    "fluid_density_vessel_l": processForm.value.fluid_density_vessel_l,
    "operating_volume_vessel": processForm.value.operating_volume_vessel,
    "full_volume_vessel": processForm.value.full_volume_vessel,
    "safety_valve_set_pressure_vessel": processForm.value.safety_valve_set_pressure_vessel,
    "main_material_vessel": processForm.value.main_material_vessel,
    "corrosion_allowance_vessel": processForm.value.corrosion_allowance_vessel,
    "diameter_vessel": processForm.value.diameter_vessel,
  
    "shell_weldedjoint_coefficient_vessel": processForm.value.shell_weldedjoint_coefficient_vessel,
    "head_weldedjoint_coefficient_vessel": processForm.value.head_weldedjoint_coefficient_vessel,
    "insulation_thickness_vessel": processForm.value.insulation_thickness_vessel,
    "insulation_material_vessel": processForm.value.insulation_material_vessel,
    "filling_ratio_vessel": processForm.value.filling_ratio_vessel,
    "max_design_pressure_jacket": processForm.value.max_design_pressure_jacket,
    "min_design_pressure_jacket": processForm.value.min_design_pressure_jacket,
    "operating_pressure_jacket": processForm.value.operating_pressure_jacket,
    "mawp_jacket": processForm.value.mawp_jacket,
    "design_temp_jacket": processForm.value.design_temp_jacket,
    "operating_temp_jacket": processForm.value.operating_temp_jacket,
    "fluid_jacket": processForm.value.fluid_jacket,
    "fluid_properties_jacket": processForm.value.fluid_properties_jacket,
    
    "operating_volume_jacket": processForm.value.operating_volume_jacket,
    "full_volume_jacket": processForm.value.full_volume_jacket,
    "safety_valve_set_pressure_jacket": processForm.value.safety_valve_set_pressure_jacket,
    "main_material_jacket": processForm.value.main_material_jacket,
    "corrosion_allowance_jacket": processForm.value.corrosion_allowance_jacket,
    "diameter_jacket": processForm.value.diameter_jacket,
   
    "shell_weldedjoint_coefficient_jacket": processForm.value.shell_weldedjoint_coefficient_jacket,
    "head_weldedjoint_coefficient_jacket": processForm.value.head_weldedjoint_coefficient_jacket,
    "insulation_thickness_jacket": processForm.value.insulation_thickness_jacket,
    "insulation_material_jacket": processForm.value.insulation_material_jacket,
    "filling_ratio_jacket": processForm.value.filling_ratio_jacket,
    "version": processForm.value.version,
    "drawings_count":  processForm.value.drawings_count,
    "a1_count": processForm.value.a1_count,
    "cal_sheet_count": processForm.value.cal_sheet_count,
    "risk_assessment_report": processForm.value.risk_assessment_report,
    "note": processForm.value.note,
    "create_user": processForm.value.create_user,
    "create_time": processForm.value.create_time,
    "modify_user": processForm.value.modify_user,
    
  
    "fluid_density_jacket_g": processForm.value.fluid_density_jacket_g,
    "fluid_density_jacket_l": processForm.value.fluid_density_jacket_l,
    "tl_to_tl_vessel": processForm.value.tl_to_tl_vessel,
    "tl_to_tl_jacket": processForm.value.tl_to_tl_jacket,
    }
    if(!obj.oid) delete obj.oid
      await UpdateEquipVesselType({
         equip_oid:equip_oid.value,
         vessel_type:equipInfo.value.vessel_type
      })
    await SaveVesselsProcessData({
     
      ...obj,
      equip_oid:equip_oid.value,
    modify_user:JSON.parse(localStorage.getItem("userMessage")).user_name,
    create_user:JSON.parse(localStorage.getItem("userMessage")).user_name,
    });
    ElMessage({
      message: "保存工艺数据成功",
      type: "success",
    });
    getBEMprocessdatasData();
  } catch (error) {
    ElMessage({
      message: "请检查工艺参数是否正确",
      type: "error",
    });
  }
};

let getBEMprocessdatasData = async () => {
  let res = await GetVesselsProcessDatas(equip_oid.value);
  
  if (res.length > 0) {
    let obj = res[0]
     for (const key in obj) {
          const lowerkey = key.toLowerCase();
          obj[lowerkey] =  obj[key];
      }

    processForm.value = obj;
    if(processForm.value.main_material_vessel&&processForm.value.main_material_vessel.includes('|')){
				shell_mat1_metaid_ForMatter.value.CS = processForm.value.main_material_vessel.split('|')[0]
				shell_mat1_metaid_ForMatter.value.values = processForm.value.main_material_vessel.split('|')[1].split(',')
			}
			if(processForm.value.main_material_jacket&&processForm.value.main_material_jacket.includes('|')){
				
				tube_mat1_metaid_ForMatter.value.CS = processForm.value.main_material_jacket.split('|')[0]
				tube_mat1_metaid_ForMatter.value.values = processForm.value.main_material_jacket.split('|')[1].split(',')
			}

  }
  return processForm.value
};

let activeName = ref("管程参数");
let showTran = ref(false);


watch(
  activeName,
  () => {
    showTran.value = false;
    setTimeout(() => {
      showTran.value = true;
    }, 30);
  },
  { immediate: true }
);

let visible = ref(false);

let checkComplete = async () => {
 let res =  await ModifyEquipStatus({
    equip_oid: equip_oid.value,
    equip_check: "30",
    equip_user: JSON.parse(localStorage.getItem("userMessage")).user_name,
  });
  if(res.data !== 'True'){
    ElMessage({
      message: res.data,
      type: "error",
    });
  }else{
    activeNumber.value = 30;
  equipInfo.value.equip_check = "30";
  sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
  ElMessage({
    message: "设计状态修改成功",
    type: "success",
  });
  await UpdateLastModifyTime({ equip_oid: equip_oid.value });
  }
 
};


let changeStatueModel =  async(num,e) => {
  let str = num === 10 ? '校核' : num === 20 ?  '已完成' : ''
	let bool = await ElMessageBox.confirm(`您确定要把当前状态修改为${str}吗？`, '提示', {
		confirmButtonText: '确定',
		cancelButtonText: '取消',
		type: 'warning',
	})
  if(bool){
	let  res = await ModifyEquipModelStatusV2({
	
	proj_oid: equipInfo.value.proj_oid,
	equip_no: equipInfo.value.equip_no,
	drawing_stage:equipInfo.value.drawing_stage,
	model_stage:num,
  equip_user: JSON.parse(localStorage.getItem("userMessage")).user_name,
});

if(res !== 'True'){
  ElMessage({
	message: res.data,
	type: "error",
  });
}else{
  activeNumberModel.value = num / 10;
equipInfo.value.model_stage = num ;
sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
ElMessage({
  message: "设计状态修改成功",
  type: "success",
});
await UpdateLastModifyTime({ equip_oid: equip_oid.value });
}

  }


}


let changeStatue =  async(num) => {
  let str = num === 10 ? '校核' : num === 20 ?  '审核' : '已完成'
  let bool = await ElMessageBox.confirm(`您确定要把当前状态修改为${str}吗？`, '提示', {
		confirmButtonText: '确定',
		cancelButtonText: '取消',
		type: 'warning',
	})
  if(bool){
    let  res = await ModifyEquipStatus({
      proj_oid: equipInfo.value.proj_oid,
	equip_no: equipInfo.value.equip_no,
	drawing_stage:equipInfo.value.drawing_stage,
  equip_check: num,
    equip_user: JSON.parse(localStorage.getItem("userMessage")).user_name,
  });

  if(res !== 'True'){
    ElMessage({
      message: res.data,
      type: "error",
    });
  }else{
    activeNumber.value = num / 10;
  equipInfo.value.equip_check = num ;
  sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
  ElMessage({
    message: "设计状态修改成功",
    type: "success",
  });
  await UpdateLastModifyTime({ equip_oid: equip_oid.value });
  }
  }
 
}

let designComplete = async () => {
 let  res = await ModifyEquipStatus({
    equip_oid: equip_oid.value,
    equip_check: "20",
    equip_checker: JSON.parse(localStorage.getItem("userMessage")).user_name,
  });

  if(res.data !== 'True'){
    ElMessage({
      message: res.data,
      type: "error",
    });
  }else{
    activeNumber.value = 20;
  equipInfo.value.equip_check = "20";
  sessionStorage.setItem(equip_oid.value, JSON.stringify(equipInfo.value));
  ElMessage({
    message: "设计状态修改成功",
    type: "success",
  });
  await UpdateLastModifyTime({ equip_oid: equip_oid.value });
  }
 
};

let objForm = {
  // 基本信息表单
  eqpdiameter: "eqpdiameter",
  // 管程表单
  tube_pressure: "tube_pressure",
  tube_design_pressure1: "tube_design_pressure1",
  tube_design_pressure2: "tube_design_pressure2",
  tube_operate_temperature_in: "tube_operate_temperature_in",
  tube_operate_temperature_out: "tube_operate_temperature_out",
  tube_design_temperature1: "tube_design_temperature1",
  tube_design_temperature2: "tube_design_temperature2",
  tube_wall_temperature: "tube_wall_temperature",
  tube_fluidname: "tube_fluidname",
  tube_fluid_property: "tube_fluid_property",
  tube_fluid_density_in: "tube_fluid_density_in",
  tube_fluid_density_out: "tube_fluid_density_out",
  tube_mat1_metaid: "tube_mat1_metaid",
  tube_mat2_metaid: "tube_mat2_metaid",
  heatexchange_tube_metaid: "heatexchange_tube_metaid ",
  tube_corrosion_allowance: "tube_corrosion_allowance ",
  tube_weldedjoint_coefficient: "tube_weldedjoint_coefficient ",
  tube_head_weldedjoint_coefficient: "tube_head_weldedjoint_coefficient ",
  tube_insulation_mat: "tube_insulation_mat ",
  tube_insulation_thickness: "tube_insulation_thickness ",
  tube_inlet_massflow: "tube_inlet_massflow ",
  tube_outlet_massflow: "tube_outlet_massflow ",
  tube_speed: " tube_speed",
  // 壳程表单
  shell_pressure: "shell_pressure",
  shell_design_pressure1: "shell_design_pressure1 ",
  shell_design_pressure2: "shell_design_pressure2 ",
  shell_operate_temperature_in: "shell_operate_temperature_in ",
  shell_operate_temperature_out: "shell_operate_temperature_out ",
  shell_design_temperature1: "shell_design_temperature1 ",
  shell_design_temperature2: "shell_design_temperature2 ",
  shell_wall_temperature: "shell_wall_temperature ",
  shell_fluidname: " shell_fluidname",
  shell_fluid_property: "shell_fluid_property ",
  shell_fluid_density_in: "shell_fluid_density_in ",
  shell_fluid_density_out: "shell_fluid_density_out ",
  shell_mat1_metaid: " shell_mat1_metaid",
  shell_mat2_metaid: " shell_mat2_metaid",
  shell_corrosion_allowance: "shell_corrosion_allowance ",
  shell_weldedjoint_coefficient: "shell_weldedjoint_coefficient ",
  shell_head_weldedjoint_coefficient: "shell_head_weldedjoint_coefficient ",
  shell_insulation_mat: "shell_insulation_mat ",
  shell_insulation_thickness: " shell_insulation_thickness",
  shell_inlet_massflow: "shell_inlet_massflow ",
  shell_outlet_massflow: " shell_outlet_massflow",
  shell_speed: "shell_speed ",
};
let processForm = ref({
 
});


watch(()=>processForm.value.diameter,()=>{
  sessionStorage.setItem('diameter',processForm.value.diameter)
},{immediate:true})

</script>
  
  <style scoped lang="scss">
.botton_sabe {
  z-index: 777;
  position: absolute;
  top: 15px;
  right: 15px;
}
.from_tenbal {
  margin-top: 20px;
}

.fontent_s {
  font-weight: bolder;
}

.item_content_d {
  padding: 5px 15px;
  border-bottom: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.equip-info {
  position: relative;
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
}

.button_flex {
		display: flex;
		flex-direction: row-reverse;
		align-items: center;
	}

.flex_style {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.equip-info {

  height: 520px;
}
.content_top {
  margin-top: 30px;
}
.button_item_b {
  margin-top: 20px;
  padding: 0 30px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

::v-deep(.el-divider--horizontal){
 margin-top: 0;
 margin-bottom: 20px;
}

::v-deep(.el-form-item--small){
  margin-bottom: 16px;
  margin-right: 18px;
}

::v-deep(.style2){
  .el-input--small{
    width:132px
  }
}
.content_steps_ab{

  display:flex;
		left: 10%;
top: 41%;
transform: translate(0%,-50%) scale(0.9);

width: 80%;
}


.table_warp{
    display: flex;
    
    width: 100%;
    .height_32{
      height: 26px;
    }
  .flex_my{
    display: flex;
    align-items: center;
  }
  .flex_center{
    display: flex;
    align-items: center;
   justify-content: center;
  }
  .left_title{

    
    white-space: pre;
    font-weight: bolder;
  }
  .box_font_left{
    
    width: 34%;
  }
  .box_font_right{
    
    width: 66%;
  }
  .font_size_small{
    font-size: 12px;
  }
  .row{
    padding-left: 10px;
    border-bottom:1px solid #999 ;
  }
    .box1{
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .font_weight{
      font-weight: bolder;
      font-size: 17px;
    }
    .border_left{
      border-left: 1px solid #999;
    }
    .border_top{
      border-top: 1px solid #999;
    }
    .border_right{
      
      border-right: 1px solid #999;
    }
    .border_bottom{
      border-bottom: 1px solid #999;
    }
    .left_table{
      width: 100%;
      border: 3px solid rgb(13, 88, 173);
      border-left:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);

      border-top:3px solid rgb(13, 88, 173);
    }
    .height_100_width_65{
      height: 94%;
      width: 100%;
    }
    .width_50{
      width: 50%;
    }
    .width_10{
      width: 10%;
    }
    .flex{
      display: flex;
    }
    .width_22{
      width:22.5%
    }
    .width_20{
      width: 18.9%;
    }
    
    .width_90{
      width: 90%;
    }

    .width_30{
      width: 30%;
    }
    .rl{
      writing-mode: vertical-rl;
    }
    .height_100{
      height: 100%;
    }
    .right_table{
      width: 58%;
      border: 1px solid rgb(13, 88, 173);
      border-right:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);

      border-top:3px solid rgb(13, 88, 173);
    }
    .all_table{
      border: 1px solid rgb(13, 88, 173);
      border-right:3px solid rgb(13, 88, 173);
      border-bottom:3px solid rgb(13, 88, 173);
      border-left:3px solid rgb(13, 88, 173);
      border-top:3px solid rgb(13, 88, 173);
      width: 100%;
     
    }
    .over_y{
      overflow-y: scroll;
    }
    .no_left_padding{
      padding-left: 0;
    }
    .padding_left_10{
      padding-left: 10px;
    }
    .width_25{
      width: 25.5%;
    }
    .width_my_1{
      width:38%
    }

    .width_1{
      width:6%
    }
    .width_2{
      width:8%
    }
    .width_3{
      width:8%
    }
    .width_4{
      width:8%
    }
    .width_5{
      width:25%
    }
    .width_6{
      width:8%
    }
    .width_7{
      width:13%
    }

    .width_8{
      width:24%
    }
    .width_my_1_1{
      width:20%
    }
    .width_my_1_2{
      width:80%
    }
	.color_gray{
		background: #eee;
	}
  }
</style>
  